Skip to content

Add example Relay provider and export relay Feedback example component#141

Merged
sjwilczynski merged 3 commits intomainfrom
alloy/make-examples-package-a-useable-canary-for-host-app-bootstrapping
Jan 29, 2025
Merged

Add example Relay provider and export relay Feedback example component#141
sjwilczynski merged 3 commits intomainfrom
alloy/make-examples-package-a-useable-canary-for-host-app-bootstrapping

Conversation

@alloy
Copy link
Member

@alloy alloy commented Jan 29, 2025

Per discussion with the PowerAutomate folks, they are wanting to integrate some Nova components. We'll be making the Feedback example component available as a canary Nova component to test the host's Nova facade setup.

This first PR only implements a Relay GraphQL provider. Adding an eventing and commanding provider should be straightforward.

⚠️ The changes in this PR are untested, as I have no bandwidth to setup a test host application to test these in. Instead, let's publish a new release and ask the PowerAutomate folks to test it, fix it, expand it.

@alloy alloy force-pushed the alloy/make-examples-package-a-useable-canary-for-host-app-bootstrapping branch from 19f69ae to 98f8ad2 Compare January 29, 2025 08:15
@alloy alloy changed the title [examples] Add example Relay provider and export relay Feedback example component Add example Relay provider and export relay Feedback example component Jan 29, 2025
@alloy alloy requested a review from sjwilczynski January 29, 2025 08:19
@alloy
Copy link
Member Author

alloy commented Jan 29, 2025

@sjwilczynski Unless you see any hard blockers, can you please merge this as soon as you have reviewed it? I would like to have a package published by tomorrow morning pacific time.

* @returns Array containing mutation committer function and a flag
* indicating whether mutation is "in flight".
*/
export function useRelayMutationWithApolloAPI<
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this change we start having two different implementation of Nova relay based environment, the other one exists in packages\nova-react-test-utils\src\relay\nova-relay-graphql.ts. We shouldn't, it's going to be confusing as hell why certain things work in Storybook differently than in imported env from examples package.

In 1JS (and in Outlook) nova env based on relay is using suspending useLazyLoadQuery and we accepted the consequence that Nova interface is not exactly followed (as we never return error) and TBH I am now surprised Teams went in different direction. Seems we need to discuss and align on this in a forum.

For now I will approve and merge the PR, to allow you to share this with folks, but without this need I would block it until we aligned, so please follow up on it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, and yesterday I was reminded of this PR that I recall was attempting to align some of this #117

@sergey-stoyan Can you make sure to join a next nova sync together with @sjwilczynski so we can discuss this topic?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, let's discuss during the next sync


/**
* Hook that wraps useQuery hook from "relay-hooks" library and returns a Nova API compatible response.
* We can't use original Relay useLazyLoadQuery, since its implementation is heavily relies on Suspense.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* We can't use original Relay useLazyLoadQuery, since its implementation is heavily relies on Suspense.
* We can't use original Relay useLazyLoadQuery, since its implementation heavily relies on Suspense.

@sjwilczynski sjwilczynski merged commit 19fa907 into main Jan 29, 2025
2 checks passed
@sjwilczynski sjwilczynski deleted the alloy/make-examples-package-a-useable-canary-for-host-app-bootstrapping branch January 29, 2025 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants